﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CleverDD.Helper.Tool;
using CleverDD.Model.Axis;

// ReSharper disable once CheckNamespace
namespace CleverDD.Helper
{
    public partial class StaticTool
    {



        public static List<AxisInfoEntity> AxisInfoList = new List<AxisInfoEntity>();

        public static void InitStaticAxisInfoList()
        {
            AxisInfoList = JsonParam.LoadParamPath<List<AxisInfoEntity>>(AxisSavePath, AxisSaveName) ??
                           new List<AxisInfoEntity>();
        }

        public static List<AxisInfoEntity> LoadAxisInfoList()
        {
            List<AxisInfoEntity> axisInfoList = new List<AxisInfoEntity>();

            axisInfoList = JsonParam.LoadParamPath<List<AxisInfoEntity>>(AxisSavePath, AxisSaveName) ??
                           new List<AxisInfoEntity>();
            return axisInfoList;

        }

        public static bool SavaAxisInfoList(List<AxisInfoEntity> axisInfoList)
        {
            axisInfoList = axisInfoList.OrderBy(s => s.SortIndex).ToList();
            return JsonParam.SaveParamPath(AxisSavePath, AxisSaveName, axisInfoList);
        }


    }
}
